package cn.z2huo.knowledge.deepunderstandjvm.oom;

import java.util.ArrayList;

/**
 * <p> 堆溢出
 * -Xms20m -Xmx20m -XX:+HeapDumpOnOutOfMemoryError
 * @author z2huo
 */
class HeapOOMTest {

    static class HeapOOMObject {

    }

    public static void main(String[] args) {

        ArrayList<HeapOOMObject> heapOOMObjects = new ArrayList<>();

        while (true) {
            heapOOMObjects.add(new HeapOOMObject());
        }

    }

}
